package com.iotechn.unimall.app.api.notice;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.UserNoticeDO;
import com.iotechn.unimall.data.dto.UserNoticeCountDTO;
import com.iotechn.unimall.data.model.Page;

/**
 * Created by rize on 2019/7/4.
 */
@HttpOpenApi(group = "notice", description = "订单服务")
public interface UserNoticeService {

    @HttpMethod(description = "我的消息")
    public Page<UserNoticeDO> getUserNoticeByUserId(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
            @HttpParam(name = "pageSize", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer pageSize,
            @HttpParam(name = "isread", type = HttpParamType.COMMON, description = "页码长度") Integer isread,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "userId") Long userId) throws ServiceException;


    @HttpMethod(description = "获取店铺的消息")
    public Page<UserNoticeDO> getUserNoticeByShopId(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer pageNo,
            @HttpParam(name = "pageSize", type = HttpParamType.COMMON, description = "页码长度", valueDef = "10") Integer pageSize,
            @HttpParam(name = "isread", type = HttpParamType.COMMON, description = "页码长度") Integer isread,
            @NotNull @HttpParam(name = "shopId", type = HttpParamType.COMMON, description = "店铺id") Integer shopId,
            @NotNull @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "用户Id") Long userId) throws ServiceException;


    @HttpMethod(description = "我的未读数量情况")
    public UserNoticeCountDTO selectUnreadCountByUserId(
            @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员Id", valueDef = "1") Long userId) throws ServiceException;

    @HttpMethod(description = "我的未读数量情况")
    public UserNoticeCountDTO selectUnreadCountByShopId(
            @NotNull @HttpParam(name = "shopId", type = HttpParamType.COMMON, description = "店铺id") Long shopId,
            @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员Id", valueDef = "1") Long userId) throws ServiceException;

    @HttpMethod(description = "设置为已读")
    public Boolean updateIsRead(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "消息id") Long id,
            @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员Id", valueDef = "1") Long userId) throws ServiceException;

    @HttpMethod(description = "设置所有已读")
    public Boolean updateIsReadAll(
            @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员Id", valueDef = "1") Long userId) throws ServiceException;

    @HttpMethod(description = "设置所有已读")
    public Boolean updateIsReadAllByShopId(
            @NotNull @HttpParam(name = "shopId", type = HttpParamType.COMMON, description = "店铺id") Long shopId,
            @HttpParam(name = "userId", type = HttpParamType.SPU_USER_ID, description = "管理员Id", valueDef = "1") Long userId) throws ServiceException;
}
